package com.hs.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.Consult;
import com.hs.sfzy.entity.ConsultLevel;
import com.hs.sfzy.entity.Specialty;
import com.hs.sfzy.mapper.ConsultLeverMapper;
import com.hs.sfzy.service.ConsultLeverService;
import com.hs.sfzy.service.ConsultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @ClassName ConsultLeverServiceImpl
 * @Description TODO
 * @Author 李明辉
 * @Date 2024年10月24日 19:30
 * @Version 1.0
 */
@Service
public class ConsultLeverServiceImpl implements ConsultLeverService {
    @Autowired
    private ConsultLeverMapper consultLeverMapper;
    @Override
    public int insert(ConsultLevel consultLevel) {
        return consultLeverMapper.insert(consultLevel);
    }



    @Override
    public int delete(Long id) {
        return consultLeverMapper.delete(id);
    }

    @Override
    public int update(ConsultLevel consultLevel) {
        return consultLeverMapper.update(consultLevel);
    }

    @Override
    public List<ConsultLevel> selectAll(ConsultLevel consultLevel) {
        return consultLeverMapper.selectAll(consultLevel);
    }

    @Override
    public ConsultLevel selectById(Long id) {
        return consultLeverMapper.selectById(id);
    }

    @Override
    public PageInfo<ConsultLevel> selectByPageInfo(int pageNum, int pageSize, ConsultLevel consultLevel) {
        PageHelper.startPage(pageNum, pageSize);
        List<ConsultLevel> consultLevels = consultLeverMapper.selectAll(consultLevel);
        PageInfo<ConsultLevel> consultLevelPageInfo = new PageInfo<ConsultLevel>(consultLevels);
        return  consultLevelPageInfo;
    }

    @Override
    public List<ConsultLevel> getInfo() {
        return consultLeverMapper.getInfo();
    }

    @Override
    public List<String> getName() {
        return consultLeverMapper.getName();
    }
}
